package ac.github.os.internal.core.condition.impl.common

import ac.github.os.internal.core.condition.Condition
import ac.github.os.internal.core.config.StringConfig
import ac.github.os.internal.core.config.get
import ac.github.os.internal.session.Session
import taboolib.common.platform.Awake

@Awake
class ContainsCondition : Condition {
    override fun doScreen(session: Session, config: StringConfig): Boolean {
        val origin = config.get<String>("origin") ?: return false
        val value = config.get<String>("val") ?: return false
        return origin.contains(value)
    }

    override val namespace: String
        get() = "contains"
}